/*
 * @Descripttion: 
 * @Author: yuxi
 * @Date: 2022-10-02 21:35:53
 * @LastEditors: yuxi
 * @LastEditTime: 2022-10-04 21:27:25
 */
const context = require.context('./', true, /\.vue$/);
export const componentRouters = context.keys().map(key => {
  if(context(key).default) {
  const component = context(key).default;
  return   { 
    path: '/' + component.name.toLowerCase(), 
    component:  component,
    title: component.title || '',
    name: component.name,
    category: component.parentTitle
  }
  } else {
    return null 
  }
}).filter(r => {
  return !!r && r.name !=='layout'
})
 